package com.ys.作业;

/**
 * 描述:
 *
 * @author CodeYang
 * @version 2021/1/6 1:43
 */
public class P1存取款与生产者消费者Test {


    public static void main(String[] args) {
        ATM atm = new ATM();
        //注入子线程任务
        DepositTask depositTask = new DepositTask(atm);
        WithdrawMoneyTask withdrawMoneyTask = new WithdrawMoneyTask(atm);

        // 创建线程
        Thread t1 = new Thread(depositTask,"存款线程");
        Thread t2 = new Thread(withdrawMoneyTask,"取款线程");

        t1.start();
        t2.start();

    }
}
